home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / amac41.zip / SIZE16.QM < prev    next >
Text File  |  1991-08-26  |  26KB  |  485 lines

  1. *                               SIZE16.QM
  2. *                   Macros To Show Byte Size of Macros
  3. *                        Written by Tom Hogshead
  4. *                                8/18/91
  5. *                                                                 -Bytes-
  6. *  @(1)   Size of SINGLE Macro                                      208   |chg
  7. *
  8. *  @(3)   Size of SINGLE Macro, Fast Windows Version                190   |new
  9. *
  10. *  @(5)   Size of ALL Macros in Document                            202   |chg
  11. *
  12. *  @(7)   Size of ALL Macros in Document, Fast Windows Version      186   |new
  13. *
  14. *      (See DSIZ.QM and DSIZ.BAT for ^F6 to sort Directory sizes by size)
  15. *
  16. *-- eoi
  17.  
  18.  
  19. * Description
  20. * --------------
  21. * SIZE16.QM are QEdit macros to quickly show byte size of a macro added
  22. * to the end of the macro with an asterisk and space in column 1.  See
  23. * the end of each of these macros for byte size using any of these
  24. * macros
  25.  
  26. * Change c:\ to a ramdisk for faster operation.  These macros require
  27. * "QEdit and QMAC v2.1, February, 1990" or later.  Batch file QMACB.BAT
  28. * shown at the end of this file is required to be in the path.
  29.  
  30. * To BEGIN, just type "START SIZE" <Enter>.  All pertinent files will
  31. * be loaded in the "Ring" for viewing, and SIZE16.MAC is read.
  32. * Alternatively, type "START SIZE 0" <Enter> and the disk copies of all
  33. * files in the "Ring" will be loaded ready for editing, saving time.
  34.  
  35. * For other macros see ALLMACRO.INF.
  36.  
  37. * 
  38. * ----------------------------------------------------------------------
  39. * @(1) Macro To Show Byte Size of SINGLE Macro Inserted At End of Macro,
  40. *      Macro File Name Optional
  41. * ----------------------------------------------------------------------
  42.  
  43. * Place cursor line anywhere in a txtfile macro and press @1.  Macro
  44. * size is added at the end of the macro as shown below along with macro
  45. * key.  Macro name may be included in byte size line by uncommenting
  46. * and adding the "macro name" lines at the end of the macro.  Macro
  47. * must be a paragraph with NO blank lines.  If the paragraph does NOT
  48. * contain a macro, the macro stops executing with a beep, meaning
  49. * "macro_begin" was not found in the paragraph.  QMACB.BAT must be in
  50. * path.  Word "macro_begin" (no _) must be used only at start of macro.
  51. * Key and "macro_begin" must be on same line.
  52.  
  53. @1 macrobegin
  54.         onewindow                       * Close all windows
  55.         unmarkblock insertline begline  * Insert temp line
  56.         dropanchor currentfilename      *
  57.         storescrbuff "9" return         * Get name to scratchbuff 9
  58.         cut                             * Delete temp line
  59.         prevpara begline                * Go to macro begin
  60.  NEXT:                                  * Get ready to mark
  61.         markcharacter                   * Markblock begin
  62.         endpara                         * Go to para end
  63.         markcharacter                   * Markblock end
  64.         gotoblockbeg                    * Get to para begin
  65.         FIND "macro" "begin" return     * Check if para is macro
  66.         "LI" return                     *
  67.         jtrue HASMACRO:                 * If para is a macro, go to HASMACRO
  68.                                         * ELSE end macro
  69.         jump END:                       *
  70.   HASMACRO:                             * Come here if para has macro
  71.         begline                         * Move to <key> begin
  72.         altwordset                      * To make all keys a word
  73.         markword                        * Mark key
  74.         defaultwordset                  * Reset for wordright below
  75.         storescrbuff "7" return         * Store <key> to scratchbuff 7
  76.         markline                        * Mark start of macro
  77.         endpara                         * Go to end of macro
  78.         editfile "c:#.qm" return        *
  79.         killfile quit                   * Kill/quit c:#.qm
  80.         makectrofscreen                 * Quick look at end of macro
  81.         writeblock return               * Write macro block to c:#.qm
  82.         addline                         * Add blank line at end of macro
  83.         editfile return                 * Load c:#.qm macro block txtfile
  84.         DOS "qmacb " currentfilename    * Make macfile of macro block
  85.         backspace backspace backspace   * Remove '.qm'
  86.         return return                   * Return from Dos
  87.         DOS "dir " currentfilename      * Get macfile size with Dir
  88.         backspace backspace             * Delete "qm"
  89.        "mac >c:!"                       * Add "mac", save list to temp
  90.         return return                   * Back fom DOS
  91.         killfile quit                   * Kill/quit c:#.qm
  92.         editfile "c:!" return           * Load Dir listing of macfile
  93.         gotoline "4" return             * Drop down
  94.         wordright wordright markword    * Mark size
  95.         storescrbuff "8" return         * Get size to scratchbuff 8
  96.         killfile quit                   * Kill/quit c:!
  97.         getscrbuff "9" return           * Insert orig file name
  98.         cut                             * Get to scrap
  99.         editfile paste return           * Load orig file                        * edit currentfilename
  100.         prevpara endpara cursordown     * Move to blank line at macro end
  101.         begline                         * Begline
  102.        "*" cursorright                  * Put asterisk in column 1
  103.         getscrbuff "8" return           * Insert byte size of macro
  104.         endline cursorright "bytes"     * Add "bytes"
  105.         cursorright                     * Space
  106.         insertdate inserttime           * Insert date and time
  107.         "(TH"                           * Author ID, (change to your inits)
  108.         cursorright                     * One space right
  109.         getscrbuff "7" return           * Get macro <key>
  110.         endline                         * Move to end of <key>
  111. * *--------------------- Insert Macro File Name ----------------------*
  112. *           ","                         * Insert comma
  113. *           cursorright                 *
  114. *           "in"                        * Insert 'in'
  115. *           cursorright                 *
  116. *           unmarkblock                 * Unmark key
  117. *           markcolumn                  * Begin column block
  118. *           currentfilename             * Insert CurrentFileName
  119. *           find "\" return "LB" return * Find '\'
  120. *           deleteblock                 * Delete path
  121. *           endline                     * Move to end of file name
  122. * *--------------------------------------------------------------------
  123.         ")" cursorleft                  * Add end parentheses
  124.  END:
  125.         unmarkblock                     * Un-mark key
  126. *
  127. * 189 bytes Thu  09-13-1990  19:13:24
  128. * 190 bytes Mon  05-06-1991  15:08:09
  129. * 199 bytes Thu  05-16-1991  11:32:44 (TH added author identification)
  130. * 209 bytes Mon  07-01-1991  15:01:30 (TH added macro <key>)
  131. * 209 bytes Sat  07-06-1991  01:31:43 (TH moved makectrofscreen up)
  132. * 208 bytes Tue  07-16-1991  21:16:56 (TH chng key mark for scan codes)
  133. * 207 bytes Sat  07-20-1991  08:59:33 (TH, removed unmarkblock)
  134. * 207 bytes Mon  07-22-1991  17:26:40 (TH, changed c:$.qm to c:#.qm)
  135. * 208 bytes Sun  07-28-1991  22:16:17 (TH, added onewindow)
  136. * 208 bytes Sun  08-18-1991  02:28:35 (TH @1)
  137.  
  138.  
  139. * 
  140. * ----------------------------------------------------------------------
  141. * @(3) Macro To Show Byte Size of SINGLE Macro Inserted At End of Macro,
  142. *      Faster Shorter Version Using Windows
  143. * ----------------------------------------------------------------------
  144.  
  145. * This macro is a modification of @1 using windows.  It is about 10%
  146. * smaller and 10% faster than @1.
  147.  
  148. * Place cursor line anywhere in a txtfile macro and press @3.  Macro
  149. * size is added at the end of the macro as shown below along with macro
  150. * key.  Macro name may be included in byte size line by uncommenting
  151. * and adding the "macro name" lines at the end of the macro.  Macro
  152. * must be a paragraph with NO blank lines.  If the paragraph does NOT
  153. * contain a macro, the macro stops executing with a beep, meaning
  154. * "macro_begin" was not found in the paragraph.  QMACB.BAT must be in
  155. * path.  Word "macro_begin" (no _) must be used only at start of macro.
  156. * Key and "macro_begin" must be on same line.
  157.  
  158.  
  159. @3 macrobegin
  160.         onewindow                       * Close all windows
  161.         unmarkblock                     * Clear any marked block to start
  162.         cursordown                      * in case we're on key line
  163.         prevpara begline                * Go to macro begin
  164.  NEXT:                                  * Get ready to mark
  165.         markcharacter                   * Markblock begin
  166.         endpara                         * Go to para end
  167.         markcharacter                   * Markblock end
  168.         gotoblockbeg                    * Get to para begin
  169.         FIND "macro" "begin" return     * Check if para is macro
  170.         "LI" return                     *
  171.   jfalse END:                           * If para is not a macro, end macro
  172.   HASMACRO:                             *ELSE come here if para is a macro
  173.         begline                         * Move to <key> begin
  174.         altwordset                      * To make all keys a word
  175.         markword                        * Mark key
  176.         defaultwordset                  * Reset for wordright below
  177.         storescrbuff "7" return         * Store <key> to scratchbuff 7
  178.         markline                        * Mark start of macro
  179.         endpara                         * Go to end of macro
  180.         addline                         * Add blank line at end of macro
  181.         horizontalwindow                * Window 2
  182.         editfile "c:~.qm" return        * Load temp file c:~.qm
  183.         copyblock                       * Copy macro to temp file
  184.         unmarkblock                     * A little less screen flicker
  185.         writeblock return               * Write macro block to c:~.qm
  186.         DOS "qmacb " currentfilename    * Make macfile of macro block
  187.         backspace backspace backspace   * Remove '.qm'
  188.         return return                   * Return from Dos
  189.         DOS "dir " currentfilename      * Get macfile size with Dir
  190.         backspace backspace             * Delete "qm"
  191.        "mac >c:~"                       * Add "mac", save list to temp
  192.         return return                   * Back fom DOS
  193.         horizontalwindow                * Window 3
  194.         editfile "c:~" return           * Load Dir listing of macfile
  195.         gotoline "4" return             * Drop down
  196.         wordright wordright markword    * Mark size
  197.         storescrbuff "8" return         * Get size to scratchbuff 8
  198.         nextwindow                      * Window 1
  199.         begline                         * Begline
  200.        "*" cursorright                  * Put asterisk in column 1
  201.         getscrbuff "8" return           * Insert byte size of macro
  202.         endline cursorright "bytes"     * Add "bytes"
  203.         cursorright                     * Space
  204.         insertdate inserttime           * Insert date and time
  205.         "(TH"                           * Author ID, (change to your inits)
  206.         cursorright                     * One space right
  207.         getscrbuff "7" return           * Get macro <key>
  208.         endline                         * Move to end of <key>
  209. * *---------------------- Insert Macro File Name ----------------------*
  210. * * (These lines may be removed if you do not wish to insert file name)
  211. *           ","                         * Insert comma
  212. *           cursorright                 *
  213. *           "in"                        * Insert 'in'
  214. *           cursorright                 *
  215. *           unmarkblock                 * Unmark key
  216. *           markcolumn                  * Begin column block
  217. *           currentfilename             * Insert CurrentFileName
  218. *           find "\" return "LB" return * Find '\'
  219. *           deleteblock                 * Delete path
  220. *           endline                     * Move to end of file name
  221. * *---------------------------------------------------------------------
  222.         ")" cursorleft                  * Add end parentheses
  223.         makectrofscreen                 * Center bytes line on screen
  224.         nextwindow                      * Window 2
  225.         killfile                        * Kill c:~.qm
  226.         nextwindow                      * Window 3
  227.         killfile                        * Kill c:~
  228.         quit                            * quit c:~
  229.         quit                            * quit c:~.qm
  230.         onewindow                       * Close all windows if QConfig set
  231.  END:                                   *  to NOT close window on quit
  232.         unmarkblock                     * Un-mark key
  233. *
  234. * 190 bytes Sun  08-18-1991  02:28:39 (TH @3)
  235.  
  236. * 
  237. * ----------------------------------------------------------------------
  238. * @(5) Macro To Show Byte Size of ALL Macros in Document,
  239. *      Includes Macro File Name
  240. * ----------------------------------------------------------------------
  241.  
  242. * Place cursor line anywhere in a txtfile macro and press @5.  Macro
  243. * size is added at the end of each macro in the document, along with
  244. * macro key.  Macro name may be included in byte size line by
  245. * uncommenting and adding the "macro name" lines at the end of the
  246. * macro.  Macro must be a paragraph with NO blank lines.  If the
  247. * paragraph does NOT contain a macro, the macro stops executing with a
  248. * beep, meaning "macro_begin" was not found in the paragraph.
  249. * QMACB.BAT must be in path.  Word "macro_begin" (no _) must be used
  250. * only at start of macro.  Key and "macro_begin" must be on same line.
  251.  
  252.  
  253. @5 macrobegin
  254.         onewindow                       * Close all windows
  255.         begfile                         * Get to begin of file
  256.         unmarkblock insertline begline  * Insert temp line
  257.         dropanchor currentfilename      *
  258.         storescrbuff "9" return         * Get name to scratchbuff 9
  259.         cut                             * Delete temp line
  260.  NEXT:                                  * Get ready to mark
  261.         FIND "macro" "begin" return     * Find start of macro
  262.         "I" return                      *
  263.         jfalse END:                     * End macro if no more macros
  264.         begline                         * Move to <key> begin
  265.         altwordset                      * To make all keys a word
  266.         markword                        * Mark key
  267.         defaultwordset                  * Reset for wordright below
  268.         storescrbuff "7" return         * Store <key> to scratchbuff 7
  269.         unmarkblock                     *
  270.         markline                        * Mark start of macro
  271.         endpara                         * Go to end of macro
  272.         makectrofscreen                 * Quick look at end of macro
  273.         writeblock "c:#.qm" return      * Write macro block to c:#.qm
  274.         addline                         * Add blank line at end of macro
  275.         editfile return quit            * Quit c:#.qm file from ring
  276.         editfile return                 * Load new macro block txtfile
  277.         DOS "qmacb " currentfilename    * Make macfile of macro block
  278.         backspace backspace backspace   * Remove '.qm'
  279.         return return                   * Return from Dos
  280.         DOS "dir " currentfilename      * Get macfile size with Dir
  281.         backspace backspace             * Delete "qm"
  282.        "mac >c:!"                       * Add "mac", save list to temp
  283.         return return                   * Back from Dos
  284.         killfile quit                   * Kill/quit c:#.qm
  285.         editfile "c:!" return           * Load Dir listing of macfile
  286.         gotoline "4" return             * Drop down
  287.         wordright wordright markword    * Mark size
  288.         storescrbuff "8" return         * Get size to scratchbuff 8
  289.         killfile quit                   * Kill/quit c:!
  290.         getscrbuff "9" return           * Insert orig file name
  291.         cut                             * Get to scrap
  292.         editfile paste return           * Load orig file
  293.         prevpara endpara cursordown     * Move to blank line at macro end
  294.         begline                         * Begline
  295.        "*" cursorright                  * Put asterisk in column 1
  296.         getscrbuff "8" return           * Insert byte size of macro
  297.         endline cursorright "bytes"     * Add "bytes"
  298.         cursorright                     * Space
  299.         insertdate inserttime           * Insert date and time
  300.         "(TH"                           * Author ID, (change to your inits)
  301.         cursorright                     * One space right
  302.         getscrbuff "7" return           * Get macro <key>
  303.         endline                         * Move to end of <key>
  304. * *---------------------- Insert Macro File Name ----------------------*
  305. * * (These lines may be removed if you do not wish to insert file name)
  306. *           ","                         * Insert comma
  307. *           cursorright                 *
  308. *           "in"                        * Insert 'in'
  309. *           cursorright                 *
  310. *           unmarkblock                 * Unmark key
  311. *           markcolumn                  * Begin column block
  312. *           currentfilename             * Insert CurrentFileName
  313. *           find "\" return "LB" return * Find '\'
  314. *           deleteblock                 * Delete path
  315. *           endline                     * Move to end of file name
  316. * *---------------------------------------------------------------------
  317.         ")" cursorleft                  * Add end parentheses
  318.         jump NEXT:                      * Loop again
  319.  END:                                   *
  320.         unmarkblock                     * Unmark key
  321.         begfile                         *
  322. *
  323. * 200 bytes Thu  09-13-1990  19:13:19
  324. * 201 bytes Mon  05-06-1991  14:36:44
  325. * 210 bytes Thu  05-16-1991  12:00:10 (TH, added author identification)
  326. * 219 bytes Mon  07-01-1991  15:01:24 (TH, added macro <key>)
  327. * 203 bytes Sat  07-06-1991  11:47:04 (TH, shortened)
  328. * 202 bytes Tue  07-16-1991  21:20:32 (TH, chng key mark for scan codes)
  329. * 201 bytes Sat  07-20-1991  09:00:24 (TH, removed unmarkblock)
  330. * 201 bytes Mon  07-22-1991  17:26:34 (TH, changed c:$.qm to c:#.qm)
  331. * 202 bytes Sun  07-28-1991  22:21:10 (TH, added onewindow)
  332. * 202 bytes Sun  08-18-1991  02:28:44 (TH @5)
  333.  
  334.  
  335. * 
  336. * ----------------------------------------------------------------------
  337. * @(7) Macro To Show Byte Size of ALL Macros in Document,
  338. *      Faster Shorter Version Using Windows
  339. * ----------------------------------------------------------------------
  340.  
  341. * This macro is a modification of @5 using windows.  It is about 10%
  342. * smaller and 10% faster than @5.
  343.  
  344. * Place cursor line anywhere in a txtfile macro and press @7.  Macro
  345. * size is added at the end of each macro in the document, along with
  346. * macro key.  Macro name may be included in byte size line by
  347. * uncommenting and adding the "macro name" lines at the end of the
  348. * macro.  Macro must be a paragraph with NO blank lines.  If the
  349. * paragraph does NOT contain a macro, the macro stops executing with a
  350. * beep, meaning "macro_begin" was not found in the paragraph.  QMACB.BAT
  351. * must be in path.  Word "macro_begin" (no _) must be used only at
  352. * start of macro.  Key and "macro_begin" must be on same line.
  353.  
  354. @7 macrobegin
  355.         onewindow                       * Close all windows
  356.         unmarkblock                     * Clear any marked block to start
  357.         begfile
  358.   NEXT:                                 * Get ready to mark
  359.         FIND "macro" "begin" return     * Check if para is macro
  360.         "I" return                      *
  361.   jfalse END:                           * If para is not a macro, end macro
  362.   HASMACRO:                             *ELSE come here if para is a macro
  363.         begline                         * Move to <key> begin
  364.         altwordset                      * To make all keys a word
  365.         markword                        * Mark key
  366.         defaultwordset                  * Reset for wordright below
  367.         storescrbuff "7" return         * Store <key> to scratchbuff 7
  368.         markline                        * Mark start of macro
  369.         endpara                         * Go to end of macro
  370.         addline                         * Add blank line at end of macro
  371.         horizontalwindow                * Window 2
  372.         editfile "c:~.qm" return        * Load temp file c:~.qm
  373.         copyblock                       * Copy macro to temp file
  374.         unmarkblock                     * A little less screen flicker
  375.         writeblock return               * Write macro block to c:~.qm
  376.         DOS "qmacb " currentfilename    * Make macfile of macro block
  377.         backspace backspace backspace   * Remove '.qm'
  378.         return return                   * Return from Dos
  379.         DOS "dir " currentfilename      * Get macfile size with Dir
  380.         backspace backspace             * Delete "qm"
  381.        "mac >c:~"                       * Add "mac", save list to temp
  382.         return return                   * Back fom DOS
  383.         horizontalwindow                * Window 3
  384.         editfile "c:~" return           * Load Dir listing of macfile
  385.         gotoline "4" return             * Drop down
  386.         wordright wordright markword    * Mark size
  387.         storescrbuff "8" return         * Get size to scratchbuff 8
  388.         nextwindow                      * Window 1
  389.         begline                         * Begline
  390.        "*" cursorright                  * Put asterisk in column 1
  391.         getscrbuff "8" return           * Insert byte size of macro
  392.         endline cursorright "bytes"     * Add "bytes"
  393.         cursorright                     * Space
  394.         insertdate inserttime           * Insert date and time
  395.         "(TH"                           * Author ID, (change to your inits)
  396.         cursorright                     * One space right
  397.         getscrbuff "7" return           * Get macro <key>
  398.         endline                         * Move to end of <key>
  399. * ---------------------- Insert Macro File Name ----------------------*
  400. * * (These lines may be removed if you do not wish to insert file name)
  401. *             ","                         * Insert comma
  402. *             cursorright                 *
  403. *             "in"                        * Insert 'in'
  404. *             cursorright                 *
  405. *             unmarkblock                 * Unmark key
  406. *             markcolumn                  * Begin column block
  407. *             currentfilename             * Insert CurrentFileName
  408. *             find "\" return "LB" return * Find '\'
  409. *             deleteblock                 * Delete path
  410. *             endline                     * Move to end of file name
  411. * ---------------------------------------------------------------------
  412.         ")" cursorleft                  * Add end parenthesis
  413.         makectrofscreen                 * Center bytes line on screen
  414.         nextwindow                      * Window 2
  415.         killfile                        * Kill c:~.qm
  416.         nextwindow                      * Window 3
  417.         killfile                        * Kill c:~
  418.         quit                            * quit c:~
  419.         quit                            * quit c:~.qm
  420.         onewindow                       * Close all windows if QConfig set
  421.  jump NEXT:                             * Do again until done
  422.  END:                                   *
  423.         unmarkblock                     * Unmark key
  424.         begfile                         *
  425. *
  426. * 186 bytes Sun  08-18-1991  02:28:49 (TH @7)
  427.  
  428. * QMACTB.BAT
  429. * -----------
  430. * The following batch file QMACB.BAT is required to be in the path to
  431. * run these macros:
  432.  
  433. *--
  434. * @echo off
  435. * rem qmacB.bat                   Sun  09-30-1990
  436. *         cls
  437. *         echo Converts %1.QM (text) To %1.MAC (binary)
  438. *         if not exist %1.QM goto NOTEXIST
  439. *         QMAC   %1.MAC      %1.QM   /B /A-       %2 %3
  440. *         goto END
  441. * :NOTEXIST
  442. *         echo %1.QM does not exist 
  443. * :END
  444. *--
  445.  
  446.  
  447. * Version History
  448. * ---------------------------------------------------------------------
  449. *         1.0  - Initial
  450. *         1.1  - Added @5 to show size of all macros in txtfile.
  451. *         1.1a - Modified @5 for paragraphs that are not macros.
  452. *         1.1b-  Changed other file names in series, this is an update.
  453. *         1.2 -  Changed documentation only.
  454. *             -  Changed .LST and .QL files.
  455. *         1.3 -  Modified macros slightly, @1 now checks if
  456. *                paragraph is a macro, like @5.
  457. *         1.3a - Removed [d:]\[path] for location of QMAC from QMACB.BAT
  458. *                files. QMAC can be located anywhere in path.
  459. *         1.3b - Modified documentation and added START.BAT.
  460. *         1.4  - Added reference to DSIZ.QM and DSIZ.BAT.
  461. *              - Changed @5 and @1 to unmark byte size after running.
  462. *         1.5  - Added author identification to macro size line.
  463. *         1.5a - Changed @5 and @1 to include macro <key> in size line.
  464. *         1.5b - Added makectrofscreen to and shortened @5.
  465. *              - Moved makectrofscreen up in @1. Updated comments.
  466. *         1.5c - Changed @5 and @1 to mark keys using scan codes correctly.
  467. *         1.5d - Removed unmarkblock from @5 and @1.
  468. *              - Included with AMAC39.ZIP, July 21, 1991.
  469. *         1.5e - Changed temporary file c:$.qm to c:#.qm in @5 and @1
  470. *                in order to measure byte size of macros produced with
  471. *                @5 and @7 in MACRxx.QM, July 22, 1991.
  472. *         1.5f - Minor documentation changes, 7/29/91.
  473. *              - Added onewindow to @5 and @1.
  474. *              - Changed markblockbeg/end to markcharacter in @1.
  475. *                       (Included in AMACxx, v 4.0)
  476. *         1.6  - Changed keys: @0 to @1 and @9 to @5.                   8/7/91
  477. *              - Modified @1 and @5 for optional macro file name.       8/7/91
  478. *              - Added shorter faster windows versions, @3 and @7.     8/18/91
  479. *
  480. *
  481. *
  482. *
  483. *
  484. *
  485.